package life.huangzhi.community.community.controller;

import life.huangzhi.community.community.dto.QuestionDTO;
import life.huangzhi.community.community.mapper.QuestionMapper;
import life.huangzhi.community.community.service.QuestionService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.annotation.Resource;
/**问题·详情页*/
@Controller
public class QuestionController {
    @Resource
    private QuestionService questionService;
    @GetMapping("/question/{id}")
    public String question(@PathVariable(name="id") Integer id, Model model){
        QuestionDTO questionDTO = questionService.getById(id);
        model.addAttribute("question",questionDTO);
        return "question";
    }
}
